package game.engine;

import org.newdawn.slick.geom.Rectangle;

public class CollisionUtilities {
	public static boolean intersectBounds(Rectangle bound1, Rectangle bound2) {
		if ((bound1.getMaxX() <= bound2.getMinX() || bound1.getMinX() >= bound2.getMaxX())
				|| (bound1.getMaxY() <= bound2.getMinY() || bound1.getMinY() >= bound2.getMaxY())) {
			return false;
		}
		else {
			return true;
		}
	}

	public static boolean doEntitiesCollide(Entity e1, Entity e2) {
		return intersectBounds(e1.getBounds(), e2.getBounds());
	}
}
